unit wgettcl;

{****************************************************************************}

interface

uses Wincrt,Windos,
      CartoCmds,        (* Contient les def. globales *)
      tit_win,get_win,gmuf_win,aux_win,coul_win;


(*************************** gethff - 3 Nov 90 *****************************)

function get_tcl(nomsc:st64;var nlig_capt,ncol_capt : word;
                   var FileFormat, PixelFormat : integer): integer;

{****************************************************************************}

implementation

(*************************** getbmp - 5 Juin 91 *****************************)

function get_tcl(nomsc:st64;var nlig_capt, ncol_capt : word;
                   var FileFormat, PixelFormat : integer): integer;

const

(* FORMAT D'IMAGE IMAGEPRO bmp *)

     card_capt = 8;

var   ier,i,l,k,n:integer;

      tcl:file;
      buf_tcl:array[1..512] of byte;
      char_tcl:array[1..512] of char;

label 999;

begin

  get_tcl := 1;

  ncol_capt := 0;
  nlig_capt := 0;

  {$I-}

  assign(tcl,nomsc);
  reset(tcl,1);
  if ioresult <> 0 then begin get_tcl := -1; goto 999; end;

(* Type TCL *)
  blockread(tcl,FileFormat,2);
  writeln('FileFormat : ',FileFormat);
  blockread(tcl,ncol_capt,2);
  writeln('ncol_capt : ',ncol_capt);
  blockread(tcl,nlig_capt,2);
  writeln('nlig_capt : ',nlig_capt);
  blockread(tcl,ier,2);
  blockread(tcl,PixelFormat,2);
  writeln('PixelFormat : ',PixelFormat);
  blockread(tcl,buf_tcl,54);

  for i := 1 to 512 do char_tcl[i] := char(buf_tcl[i]);
(*  writeln('BMP_ID : '+val_id[1]+val_id[2]);  *)


  close(tcl);
  get_tcl := 0;

999:end;

end.

